﻿$(function () {
    $("#form1").validate({
        errorElement: "span",
        errorClass: "ui-state-error"
    });

    $("#saveBt").button({
        icons: {
            primary: "ui-icon-disk"
        }
    });
    $("#cancelBt").button({
        icons: {
            primary: "ui-icon-arrowreturnthick-1-w"
        }
    });

    $("#tabs").tabs();

    //延迟Alert
    if (window["ERROR_ALERT"]) {
        if (typeof window["ERROR_ALERT"] == "string") {
            if (!$("#alertDiv").length) {
                $("<div id='alertDiv' title='提示'>" + window["ERROR_ALERT"] + "</div>").appendTo("body");
            }
            $("#alertDiv").dialog({
                modal: true,
                buttons: {
                    Ok: function () {
                        $(this).dialog("close");
                    }
                }
            }).dialog("open");
            //alert(window["ERROR_ALERT"]);
        }
    }
});